// 2010-03-17 - M. Caputo

#include "CVertex.h"

CVertex::CVertex()
{
	vertexData[0] = 0;
	vertexData[1] = 0;
	vertexData[2] = 0;
	colored = false;
}

CVertex::CVertex(float x, float y, float z)
{
	vertexData[0] = x;
	vertexData[1] = y;
	vertexData[2] = z;
	colored = false;
}

CVertex::CVertex(float x, float y, float z, const QColor & color)
{
	vertexData[0] = x;
	vertexData[1] = y;
	vertexData[2] = z;
	colored = true;
	objectColor = color;
}

float* CVertex::vertex()
{
	return vertexData;
}

float CVertex::x()
{
	return vertexData[0];
}

float CVertex::y()
{
	return vertexData[1];
}

float CVertex::z()
{
	return vertexData[2];
}

bool CVertex::hasColor()
{
	return colored;
}

const QColor & CVertex::color()
{
	return objectColor;
}
